<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="com.byComputer.bo.*"%>
<%@page import="com.byComputer.vo.*"%>
<%
	response.setCharacterEncoding("utf-8");
	ComputerService cs = new ComputerService();
	List<Computer> computerList = cs.findAddComputer();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv=Content-Type content="text/html; charset=utf-8" />
		<link href="../css/style.css" type="text/css" rel="stylesheet" />
	</head>

	<body topMargin="10">
		<div id="append_parent"></div>
		<table cellSpacing=6 cellPadding=2 width="100%" border="0">

			<tbody>
				<tr>
					<td>
						<table class="tableborder" cellSpacing="0" cellPadding="0"
							width="100%" border="0">
							<tbody>

								<tr class="header">
									<td class="altbg1" width="15%">
										<b>:型号</B>
									</td>
									<td class="altbg1" width="20%">
										<b>产品图片</b>
									</td>
									<td class="altbg1" width="30%">
										<b>产品说明</b>
									</td>

									<td class="altbg1" width="10%">
										<b>产品报价</b>
									</td>
									<td class="altbg1">
										&nbsp;
									</td>

								</tr>
							</tbody>
							<tbody>
								<%
								for (Computer computer : computerList) {
								%>
								<tr>
									<td class="altbg2">
										<%=computer.getModel()%>
									</td>
									<td class="altbg2">
										<img src="../image/<%=computer.getPicture()%>" width="150"
											height="90" />
									</td>
									<td class="altbg2">
										<%=computer.getDescription()%>
									</td>
									<td class="altbg2">
										￥
										<%=computer.getPrice()%>
									</td>
									<td class="altbg2">
										<a href="add_item.jsp?computerId=<%=computer.getId()%>">
											购买</a> &nbsp;&nbsp;&nbsp;
									</td>
								</tr>
								<%--在链接的地址后面加上"?id=..."可以达到submit同样的效果,将我们需要的数据带到目的地--%>
								<%
								}
								%>
							</tbody>
						</table>
						<br />
						<center>
							<input class="button" type="button" value="查看购物车"
								name="settingsubmit" onclick="location = 'cart.jsp';">
						</center>
					</td>
				</tr>
			</tbody>
		</table>

	</body>
</html>
